<?php
namespace app\index\controller;

class Tools
{

    // 二维码
    public function qrcode()
    {
        $savePath = APP_PATH . '/../Public/qrcode/';
        $webPath = '/qrcode/';
        $qrData = 'http://www.cnblogs.com/nickbai/';
        $qrLevel = 'H';
        $qrSize = '8';
        $savePrefix = 'NickBai';

        if($filename = createQRcode($savePath, $qrData, $qrLevel, $qrSize, $savePrefix)){
            $pic = $webPath . $filename;
        }
        echo "<img src='".$pic."'>";
    }


}
